# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="Redsn0w is a lightweight, multi-platform jailbreaking and unlocking tool for the iPhone 2G (original iPhone), the iPhone 3G, iPhone 3GS and also the iPod touch (first generation and second generation)."
HOMEPAGE="http://blog.iphone-dev.org"
SRC_URI="http://iphoneoverlay.googlecode.com/files/redsn0w-0.8.tar.bz2"

LICENSE="iPhone-Dev Team License"
SLOT="0"
KEYWORDS="x86 amd64"
IUSE=""

RDEPEND=">=x11-libs/gtk+-2
		>=dev-libs/libusb-0.1.11
		>=net-misc/curl-7.19.4
		>=dev-libs/openssl-0.9.8"

src_unpack() {
	unpack ${A}
	cd "${S}"
}

src_install() {
	mkdir -p "${D}"usr/share/${PN}
	mv *.txt "${D}"usr/share/${PN} || die \
		"Installing License and Docs failed."
	mkdir -p "${D}"usr/bin/
	mv redsn0w "${D}"usr/bin/ || die \
		"Installing binary failed."
	for c in hi lo; do
		for d in 16 32 48 128; do
			insinto /usr/share/icons/${c}color/${d}x${d}/apps
			newins image/${c}${d}-app-redsn0w.png redsn0w.png
		done
	done
	insinto /usr/share/applications
	doins redsn0w.desktop
}

